package Demo2;
class Out{
    public int date1 = 1;
    private static int date2;
    public static void print(){
        In in = new In();
        in.test();
        System.out.println(in.date3 + " " + in.date4);
        System.out.println("外部类！");
    }
    public void print1(){
        System.out.println("1232132");
    }
    static class In{
        public int date3 = 3;
        private static int date4 = 4;
        public void test(){
            Out out = new Out();
            System.out.println(out.date1);
            out.print1();
            date2 = 2;
            /*date1 = 1;不能访问外部类的非静态成员*/
            print();
           /* Out.this.print1();*/
            System.out.println("内部类！");
        }
    }
}
public class Test {
    public static void main(String[] args) {
        /*Out.In in1 = new Out().new In();错误写法*/
        Out out = new Out();
        out.print();
        Out.In in = new Out.In();//创建静态内部类
        in.test();
        System.out.println(in.date3);
    }
}
